﻿using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using RapidSalesAdminPortalAPI.DataAccess.NotDBtables;

namespace RapidSalesAdminPortalAPI.DataAccess
{
    public partial class RS_AdmPortalContext : DbContext
    {
        public RS_AdmPortalContext()
        {
        }

        public RS_AdmPortalContext(DbContextOptions<RS_AdmPortalContext> options)
            : base(options)
        {
        }

        public virtual DbSet<FrIpAdministratorAccount> FrIpAdministratorAccounts { get; set; } = null!;
        public virtual DbSet<FrIpEvent> FrIpEvents { get; set; } = null!;
        public virtual DbSet<FrIpEventTimeSlot> FrIpEventTimeSlots { get; set; } = null!;
        public virtual DbSet<FrIpMasterDatum> FrIpMasterData { get; set; } = null!;
        public virtual DbSet<FrIpMultiLangSet> FrIpMultiLangSets { get; set; } = null!;
        public virtual DbSet<FrIpProduct> FrIpProducts { get; set; } = null!;
        public virtual DbSet<FrIpProductEvent> FrIpProductEvents { get; set; } = null!;
        public virtual DbSet<FrIpSalesPoint> FrIpSalesPoints { get; set; } = null!;
        public virtual DbSet<FrIpSalesPointProduct> FrIpSalesPointProducts { get; set; } = null!;
        public virtual DbSet<FrIpTransactionHistory> FrIpTransactionHistories { get; set; } = null!;

        public virtual DbSet<ProductListFrontModel> ProductListFrontModel { get; set; } = null!;

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
                optionsBuilder.UseSqlServer("Data Source=143.64.228.41;uid=SSIS;pwd=1236;Initial Catalog=RS_AdmPortal");
            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<FrIpAdministratorAccount>(entity =>
            {
                entity.ToTable("FR_IP_AdministratorAccount");

                entity.Property(e => e.Id).ValueGeneratedNever();

                entity.Property(e => e.AccountName).HasMaxLength(100);

                entity.Property(e => e.CreateDate).HasColumnType("datetime");

                entity.Property(e => e.Email).HasMaxLength(100);

                entity.Property(e => e.LastLoginTime).HasColumnType("datetime");

                entity.Property(e => e.LoginName).HasMaxLength(100);

                entity.Property(e => e.Password).HasMaxLength(50);

                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
            });

            modelBuilder.Entity<FrIpEvent>(entity =>
            {
                entity.ToTable("FR_IP_Event");

                entity.Property(e => e.Id).ValueGeneratedNever();

                entity.Property(e => e.CreateDate).HasColumnType("datetime");

                entity.Property(e => e.EventAk)
                    .HasMaxLength(200)
                    .HasColumnName("EventAK");

                entity.Property(e => e.EventCode).HasMaxLength(200);

                entity.Property(e => e.EventDescriptionEn)
                    .HasMaxLength(200)
                    .HasColumnName("EventDescription_EN");

                entity.Property(e => e.EventDescriptionOt)
                    .HasMaxLength(200)
                    .HasColumnName("EventDescription_OT");

                entity.Property(e => e.EventDescriptionSc)
                    .HasMaxLength(200)
                    .HasColumnName("EventDescription_SC");

                entity.Property(e => e.EventDescriptionTc)
                    .HasMaxLength(200)
                    .HasColumnName("EventDescription_TC");

                entity.Property(e => e.EventNameEn)
                    .HasMaxLength(200)
                    .HasColumnName("EventName_EN");

                entity.Property(e => e.EventNameOt)
                    .HasMaxLength(200)
                    .HasColumnName("EventName_OT");

                entity.Property(e => e.EventNameSc)
                    .HasMaxLength(200)
                    .HasColumnName("EventName_SC");

                entity.Property(e => e.EventNameTc)
                    .HasMaxLength(200)
                    .HasColumnName("EventName_TC");

                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
            });

            modelBuilder.Entity<FrIpEventTimeSlot>(entity =>
            {
                entity.ToTable("FR_IP_EventTimeSlots");

                entity.Property(e => e.Id).ValueGeneratedNever();

                entity.Property(e => e.ClosingTime).HasMaxLength(100);

                entity.Property(e => e.EndDateTime).HasColumnType("datetime");

                entity.Property(e => e.OpeningTime).HasMaxLength(100);

                entity.Property(e => e.StartDateTime).HasColumnType("datetime");
            });

            modelBuilder.Entity<FrIpMasterDatum>(entity =>
            {
                entity.ToTable("FR_IP_MasterData");

                entity.Property(e => e.Id).ValueGeneratedNever();

                entity.Property(e => e.Code).HasMaxLength(200);

                entity.Property(e => e.CreateDate).HasColumnType("datetime");

                entity.Property(e => e.Description).HasMaxLength(1000);

                entity.Property(e => e.Name).HasMaxLength(200);

                entity.Property(e => e.OptionSetGroup).HasMaxLength(200);

                entity.Property(e => e.ParentCode).HasMaxLength(200);

                entity.Property(e => e.UpdateDate).HasColumnType("datetime");

                entity.Property(e => e.Value).HasMaxLength(200);
            });

            modelBuilder.Entity<FrIpMultiLangSet>(entity =>
            {
                entity.ToTable("FR_IP_MultiLangSet");

                entity.Property(e => e.Id).ValueGeneratedNever();

                entity.Property(e => e.Code).HasMaxLength(100);

                entity.Property(e => e.Description).HasMaxLength(500);

                entity.Property(e => e.Value).HasMaxLength(500);
            });

            modelBuilder.Entity<FrIpProduct>(entity =>
            {
                entity.ToTable("FR_IP_Product");

                entity.Property(e => e.Id).ValueGeneratedNever();

                entity.Property(e => e.CreateDate).HasColumnType("datetime");

                entity.Property(e => e.Currency).HasMaxLength(200);

                entity.Property(e => e.MatrixCellAk)
                    .HasMaxLength(200)
                    .HasColumnName("MatrixCellAK");

                entity.Property(e => e.ProductCode).HasMaxLength(200);

                entity.Property(e => e.ProductNameEn)
                    .HasMaxLength(200)
                    .HasColumnName("ProductName_EN");

                entity.Property(e => e.ProductNameOt)
                    .HasMaxLength(200)
                    .HasColumnName("ProductName_OT");

                entity.Property(e => e.ProductNameSc)
                    .HasMaxLength(200)
                    .HasColumnName("ProductName_SC");

                entity.Property(e => e.ProductNameTc)
                    .HasMaxLength(200)
                    .HasColumnName("ProductName_TC");

                entity.Property(e => e.Thumbnail).HasMaxLength(200);

                entity.Property(e => e.TicketDescriptionEn)
                    .HasMaxLength(200)
                    .HasColumnName("TicketDescription_EN");

                entity.Property(e => e.TicketDescriptionOt)
                    .HasMaxLength(2000)
                    .HasColumnName("TicketDescription_OT");

                entity.Property(e => e.TicketDescriptionSc)
                    .HasMaxLength(200)
                    .HasColumnName("TicketDescription_SC");

                entity.Property(e => e.TicketDescriptionTc)
                    .HasMaxLength(200)
                    .HasColumnName("TicketDescription_TC");

                entity.Property(e => e.UnitPrice).HasColumnType("decimal(18, 4)");

                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
            });

            modelBuilder.Entity<FrIpProductEvent>(entity =>
            {
                entity.ToTable("FR_IP_ProductEvents");

                entity.Property(e => e.Id).ValueGeneratedNever();
            });

            modelBuilder.Entity<FrIpSalesPoint>(entity =>
            {
                entity.ToTable("FR_IP_SalesPoint");

                entity.HasIndex(e => e.Code, "UK_FR_IP_SalesPoint_Code")
                    .IsUnique();

                entity.Property(e => e.Id).ValueGeneratedNever();

                entity.Property(e => e.Code).HasMaxLength(200);

                entity.Property(e => e.CreateDate).HasColumnType("datetime");

                entity.Property(e => e.DescriptionEn)
                    .HasMaxLength(200)
                    .HasColumnName("Description_EN");

                entity.Property(e => e.DescriptionSc)
                    .HasMaxLength(200)
                    .HasColumnName("Description_SC");

                entity.Property(e => e.DescriptionTc)
                    .HasMaxLength(200)
                    .HasColumnName("Description_TC");

                entity.Property(e => e.DirectUrl).HasMaxLength(200);

                entity.Property(e => e.NameEn)
                    .HasMaxLength(200)
                    .HasColumnName("Name_EN");

                entity.Property(e => e.NameSc)
                    .HasMaxLength(200)
                    .HasColumnName("Name_SC");

                entity.Property(e => e.NameTc)
                    .HasMaxLength(200)
                    .HasColumnName("Name_TC");

                entity.Property(e => e.OperationAreaId).HasColumnName("OperationAreaID");

                entity.Property(e => e.Passcode).HasMaxLength(50);

                entity.Property(e => e.QrCodeUrl)
                    .HasMaxLength(200)
                    .HasDefaultValueSql("((0))");

                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
            });

            modelBuilder.Entity<FrIpSalesPointProduct>(entity =>
            {
                entity.ToTable("FR_IP_SalesPointProducts");

                entity.Property(e => e.Id).ValueGeneratedNever();

                entity.Property(e => e.RapidSalesEndDate).HasColumnType("datetime");

                entity.Property(e => e.RapidSalesRemarksEng)
                    .HasMaxLength(200)
                    .HasColumnName("RapidSalesRemarks_Eng");

                entity.Property(e => e.RapidSalesRemarksSc)
                    .HasMaxLength(200)
                    .HasColumnName("RapidSalesRemarks _ SC");

                entity.Property(e => e.RapidSalesRemarksTc)
                    .HasMaxLength(200)
                    .HasColumnName("RapidSalesRemarks _ TC");

                entity.Property(e => e.RapidSalesStartDate).HasColumnType("datetime");

                entity.Property(e => e.RapidSalesThumbnailUrl)
                    .HasMaxLength(200)
                    .HasColumnName("RapidSalesThumbnailURL");
            });

            modelBuilder.Entity<FrIpTransactionHistory>(entity =>
            {
                entity.ToTable("FR_IP_TransactionHistory");

                entity.Property(e => e.Id).ValueGeneratedNever();

                entity.Property(e => e.CheckOutAmount).HasColumnType("decimal(18, 4)");

                entity.Property(e => e.CheckOutProducts).HasMaxLength(200);

                entity.Property(e => e.CheckOutTime).HasColumnType("datetime");

                entity.Property(e => e.DataFeedAlertCode).HasMaxLength(200);

                entity.Property(e => e.DataFeedAmount).HasMaxLength(200);

                entity.Property(e => e.DataFeedBankRef).HasMaxLength(1000);

                entity.Property(e => e.DataFeedPayDollarPaymentRef).HasMaxLength(1000);

                entity.Property(e => e.DataFeedPaymentMethod).HasMaxLength(200);

                entity.Property(e => e.DataFeedPaymentRef).HasMaxLength(1000);

                entity.Property(e => e.DataFeedReceivedOn).HasColumnType("datetime");

                entity.Property(e => e.DataFeedResults).HasMaxLength(1000);

                entity.Property(e => e.DataFeedSourceData).HasColumnType("ntext");

                entity.Property(e => e.DataFeedTransactionTime).HasColumnType("datetime");

                entity.Property(e => e.GuestContactNumber).HasMaxLength(100);

                entity.Property(e => e.GuestEmail).HasMaxLength(200);

                entity.Property(e => e.GuestName).HasMaxLength(200);

                entity.Property(e => e.LastUpdatedOn).HasColumnType("datetime");

                entity.Property(e => e.OrderNo).HasMaxLength(200);

                entity.Property(e => e.TransactionStatus).HasMaxLength(50);
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
